package com.lixin.utils;

import cn.hutool.core.lang.Validator;

public class ValidatorUtil {
    public static boolean isNumber(String s) {
        return Validator.isMatchRegex("^\\d+$", s);
    }

    public static boolean notBlank(String s) {
        return Validator.isMatchRegex("^\\S+$", s);
    }

    public static boolean lengthLimit(int min, int max, String s) {
        String reg = String.format("^\\S{%d,%d}$", min, max);
        return Validator.isMatchRegex(reg, s);
    }
}
